.class public Lcom/brixd/niceapp/db/AppDao;
.super Ljava/lang/Object;
.source "AppDao.java"


# instance fields
.field private mAppDao:Lcom/brixd/niceapp/db/AppEntityDao;


# direct methods
.method public constructor <init>()V
    .registers 2

    .prologue
    .line 14
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 15
    invoke-static {}, Lcom/brixd/niceapp/service/AppService;->getDaoSession()Lcom/brixd/niceapp/db/DaoSession;

    move-result-object v0

    invoke-virtual {v0}, Lcom/brixd/niceapp/db/DaoSession;->getAppEntityDao()Lcom/brixd/niceapp/db/AppEntityDao;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/db/AppDao;->mAppDao:Lcom/brixd/niceapp/db/AppEntityDao;

    .line 16
    return-void
.end method


# virtual methods
.method public insertOrReplaceAppEntivity(Lcom/brixd/niceapp/db/AppEntity;)V
    .registers 3
    .param p1, "entity"    # Lcom/brixd/niceapp/db/AppEntity;

    .prologue
    .line 19
    iget-object v0, p0, Lcom/brixd/niceapp/db/AppDao;->mAppDao:Lcom/brixd/niceapp/db/AppEntityDao;

    invoke-virtual {v0, p1}, Lcom/brixd/niceapp/db/AppEntityDao;->insert(Ljava/lang/Object;)J

    .line 20
    return-void
.end method

.method public insertOrReplaceAppEntivity(Ljava/util/ArrayList;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/db/AppEntity;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 23
    .local p1, "entities":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/db/AppEntity;>;"
    iget-object v0, p0, Lcom/brixd/niceapp/db/AppDao;->mAppDao:Lcom/brixd/niceapp/db/AppEntityDao;

    invoke-virtual {v0, p1}, Lcom/brixd/niceapp/db/AppEntityDao;->insertOrReplaceInTx(Ljava/lang/Iterable;)V

    .line 24
    return-void
.end method

.method public queryAppEntivities(Ljava/lang/String;)Ljava/util/List;
    .registers 11
    .param p1, "key"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/db/AppEntity;",
            ">;"
        }
    .end annotation

    .prologue
    const/4 v8, 0x1

    const/4 v7, 0x0

    .line 27
    iget-object v1, p0, Lcom/brixd/niceapp/db/AppDao;->mAppDao:Lcom/brixd/niceapp/db/AppEntityDao;

    invoke-virtual {v1}, Lcom/brixd/niceapp/db/AppEntityDao;->queryBuilder()Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v0

    .line 28
    .local v0, "qb":Lde/greenrobot/dao/query/QueryBuilder;, "Lde/greenrobot/dao/query/QueryBuilder<Lcom/brixd/niceapp/db/AppEntity;>;"
    sget-object v1, Lcom/brixd/niceapp/db/AppEntityDao$Properties;->Title:Lde/greenrobot/dao/Property;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "%"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "%"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lde/greenrobot/dao/Property;->like(Ljava/lang/String;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v1

    sget-object v2, Lcom/brixd/niceapp/db/AppEntityDao$Properties;->SubTitle:Lde/greenrobot/dao/Property;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "%"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "%"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lde/greenrobot/dao/Property;->like(Ljava/lang/String;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v2

    new-array v3, v8, [Lde/greenrobot/dao/query/WhereCondition;

    sget-object v4, Lcom/brixd/niceapp/db/AppEntityDao$Properties;->Tags:Lde/greenrobot/dao/Property;

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "%"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, "%"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Lde/greenrobot/dao/Property;->like(Ljava/lang/String;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v4

    aput-object v4, v3, v7

    invoke-virtual {v0, v1, v2, v3}, Lde/greenrobot/dao/query/QueryBuilder;->whereOr(Lde/greenrobot/dao/query/WhereCondition;Lde/greenrobot/dao/query/WhereCondition;[Lde/greenrobot/dao/query/WhereCondition;)Lde/greenrobot/dao/query/QueryBuilder;

    .line 29
    new-array v1, v8, [Lde/greenrobot/dao/Property;

    sget-object v2, Lcom/brixd/niceapp/db/AppEntityDao$Properties;->AppId:Lde/greenrobot/dao/Property;

    aput-object v2, v1, v7

    invoke-virtual {v0, v1}, Lde/greenrobot/dao/query/QueryBuilder;->orderDesc([Lde/greenrobot/dao/Property;)Lde/greenrobot/dao/query/QueryBuilder;

    .line 30
    invoke-virtual {v0}, Lde/greenrobot/dao/query/QueryBuilder;->build()Lde/greenrobot/dao/query/Query;

    move-result-object v1

    invoke-virtual {v1}, Lde/greenrobot/dao/query/Query;->list()Ljava/util/List;

    move-result-object v1

    return-object v1
.end method
